home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
me_cd22.zip
/
MUTT2.ZIP
/
FILTER.MUT
< prev
next >
Wrap
Lisp/Scheme
|
1992-04-27
|
832b
|
41 lines
;; C Durland Public Domain
(include me2.h)
(defun filter
{
(bool input_from_reg)
(int bag-in bag-out)
(string filter-name)
(filter-name
(ask (if (arg-flag) "Suck in output from filter: " "Filter region: ")))
(input_from_reg FALSE)(bag-in -1)
(if (not (arg-flag))
{
(clear-bag CUT-BUFFER) (append-to-bag CUT-BUFFER APPEND-REGION)
(bag-in CUT-BUFFER) (input_from_reg TRUE)
})
(bag-out (create-bag))
(if (OS-filter filter-name bag-in bag-out)
{
(if input_from_reg (delete-region))
(insert-bag bag-out)
})
(free-bag bag-out)
})
(defun
shove-region-to-process
{
(int bag-id)
(append-to-bag (bag-id (create-bag)) APPEND-REGION)
(OS-filter (ask "Shove region to process: ") bag-id)
(free-bag bag-id)
}
)